Pakistani security agencies have nabbed the alleged mastermind of the audacious October 10 terror attack on the General Headquarters in Rawalpindi.